package roborally.Commands;

import roborally.Robot;

/**
 * A class of Move-commands for playing the roborally game.
 * 
 * @version  2.90
 * @author   Michiel Ruelens & Dieter Naten
 */
public class Move extends Command {
	
	/**
	 * Create a new move command.
	 */
	public Move(){
		this.setStringForm("move");
	}

	/**
	 * Makes the robot move if it has sufficient energy.
	 */
	@Override
	public void execute(Robot robot) {
		if(robot.getEnergy()>=robot.getCostToMove()){
			robot.move();
		}
		else{
			System.out.println("Nothing executed because of insufficient energy to move.");
		}		
	}

}
